package exercise.day14;
import java.util.*;

/**
 * @author Dianzhi Han
 * @version 1.0
 * @description: TODO
 * @date 2022/11/24 12:01
 */
public class HJ73_Date2Days {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int year = in.nextInt();
        int month = in.nextInt();
        int day = in.nextInt();
        int sum = 0;
        int[] days = new int[]{0,31,28,31,30,31,30,31,31,30,31,30,31}; //数组保存了每个的日子
        //如果是闰年366天  非闰年365天
        //如果闰年过了2.29才会+1
        if(isRunYear(year)){
            days[2] += 1;
        }

        for(int i = 0;i<month ; i++){
            sum += days[i];
        }

        sum += day;

        System.out.print(sum);
    }


    //判断闰年的函数
    public static boolean isRunYear(int year){
        if((year%4 ==0 && year %100 !=0) || (year % 400 ==0)){
            return true;
        }

        return false;
    }
}
